<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
        <ui:define name="top">

    </ui:define>

    <ui:define name="left">

    </ui:define>
        <ui:define name="content" >
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <p:panel header="View Announcement" rendered="#{loginBacking.viewAnnouncement}">
                <h:panelGrid columns="2" >
                    <h:outputText value="From: "/>
                    <h:outputText value="#{announcementController.selected.sender.name}" />
                    <h:outputText value="To: "/>
                    <h:outputText value="#{announcementController.selected.departmentRecipientToString}" />                   
                    <h:outputText value="Date Sent:"/>
                    <h:outputText value="#{announcementController.selected.sentAt.toString()}" >
                    </h:outputText>
                    <h:outputText value="Subject"/>
                    <h:outputText value="#{announcementController.selected.title}" />
                    <h:outputText value="Message: "/>
                    <h:outputText value="#{announcementController.selected.body}" escape="false"/>
                    
                </h:panelGrid>
                <br />
                <h:commandButton action="#{announcementController.markAsUnRead}" value="Mark as Unread" rendered="#{announcementController.forInbox}"/>
                <br />
                <br />
                <h:commandLink value="Back" action="#{announcementController.discardAndRediret}" />
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
